{% extends 'TopxiaWebBundle:Default:layout.html.twig' %}

{% block content %}

<div class="es-row-wrap container-gap">

  {% if blocks.home_top_banner %}
    <div class="homepage-feature homepage-feature-slides mbl">
      <div class="cycle-pager"></div>
      {{ blocks.home_top_banner|raw }}
    </div>
  {% endif %}

  <div class="row row-9-3">

    <div class="col-md-9">
      <div class="es-box">
        <div class="es-box-heading"><h2>课程</h2></div>
        <div class="es-box-body">
          {% if courses %}
            {{ render(controller('TopxiaWebBundle:Course:coursesBlock', {courses:courses, view: 'list'})) }}
            {% if courses|length >= 12 %}
              <a class="btn btn-default btn-lg btn-block" href="{{ path('course_explore') }}">更多课程</a>
            {% endif %}
          {% else %}
            <div class="empty">还没有发布的课程</div>
          {% endif %}
        </div>
      </div>

      {% if setting('course.live_course_enabled') %}

      <div class="es-box">
        <div class="es-box-heading"><h2>近期直播</h2></div>
        <div class="es-box-body">
          {{ render(controller('TopxiaWebBundle:LiveCourse:coursesBlock', { courses:recentLiveCourses, view: 'list'})) }}
          {% if recentLiveCourses|length >= 1 %}
            <a class="btn btn-default btn-lg btn-block" href="{{ path('live_course_explore') }}">更多课程</a>
          {% endif %}
        </div>
      </div>
      
      {% endif %}

    </div>

    <div class="col-md-3">
      {{ render(controller('TopxiaWebBundle:Default:latestReviewsBlock',{number:5})) }}
    </div>

  </div>
  {% if setting('group').group_show|default(1) %}
  <div class="row row-9-3">

    <div class="col-md-9">
      <div class="es-box">
        <div class="es-box-heading"><h2>最热小组</h2><a href="{{path('group_search_group')}}" class="pull-right">&raquo;更多</a></div>
        <div class="es-box-body">
           {{ render(controller('TopxiaWebBundle:Group:hotGroup')) }}
        </div>
      </div>
    </div>

    <div class="col-md-3">
        <div class="es-box">
        <div class="es-box-heading"><h2>最热话题</h2></div>
        <div class="es-box-body">
          {{ render(controller('TopxiaWebBundle:Group:hotTHread')) }}
        </div>
      </div>
    </div>

  </div>
  {% endif %}
  <div class="row"><div class="col-md-12"></div></div>

</div>
{% endblock %}
